home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 15976 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: news.nyu.edu!schonberg!dewar
  2. From: dewar@cs.nyu.edu (Robert Dewar)
  3. Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.edu
  4. Subject: Re: ANSI C and POSIX (was Re: C/C++ knocks the crap out of Ada)
  5. Date: 8 Apr 1996 21:18:43 -0400
  6. Organization: Courant Institute of Mathematical Sciences
  7. Message-ID: <dewar.829012486@schonberg>
  8. References: <JSA.96Feb16135027@organon.com> <dewar.828879781@schonberg> <4k9qhe$65r@solutions.solon.com> <dewar.828936837@schonberg> <4kb2j8$an0@solutions.solon.com> <4kbrt5$k3h@mulga.cs.mu.OZ.AU>
  9. NNTP-Posting-Host: schonberg.cs.nyu.edu
  10. X-Newsreader: NN version 6.5.0 (NOV)
  11.  
  12. Peter said
  13.  
  14. ">Something which works only on some systems is
  15. >not a portability problem *if there is no standard saying it works*.  Likewise
  16. >       i = ++i;
  17. >producing different results on different machines is not a "portability
  18. >problem"."
  19.  
  20. This is a perfect case of Peter saying: Language X ensures that all
  21. portable programs are portable, therefore there are no portability
  22. problems. This is of course vacuously true for all languages!
  23.  
  24. By a "portability problem" most people mean that you take a program 
  25. written in language X, and try to move it to machine Y from machine Z,
  26. and it does not work any more.
  27.  
  28. Portability problems are most definitely caused by writing non-portable
  29. code. In fact in the absence of errors in the compiler of environment
  30. on machine Y or machine Z, this is the ONLY source of portability
  31. problems.
  32.  
  33. However, it is definitely the case that languages vary in the ease with
  34. which people end up writing non-portable code deliberately or
  35. accidentally.
  36.  
  37. For example, in C, we can't declare an integer variable without 
  38. introducing a potential portability dpeendence on the range. Careful
  39. writing can get around this, or certainly minimize it, but it's often
  40. the source of porability problems. Typical Ada prograns do not suffer
  41. from this particular problem, because even a novice Ada programmer
  42. knows to avoid the use of predefined types in code that is intended
  43. to be portable.
  44.  
  45.